{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="row">
                <!--搜索框开始-->
                <div class="col-sm-12">
                    <div class="layui-form layui-form-item">
                        <div class="layui-input-inline layui-form">
                            <select name="mo_pay_type" lay-search="">
                                <option  value="">不限支付方式</option>
                                <option  value="1">支付宝</option>
                                <option  value="2">微信</option>
                            </select>
                        </div>
                        <div class="layui-input-inline layui-form">
                            <select name="mo_status" lay-search="">
                                <option  value="">不限开奖状态</option>
                                <option  value="1">进行中</option>
                                <option  value="2">已开奖</option>
                                <option  value="3">已取消</option>
                            </select>
                        </div>
                        <div class="layui-input-inline layui-form">
                            <select name="mo_store_uid" lay-search="">
                                <option  value="">不限店主</option>
                                <option  value="0">产品池库购买</option>
                                {volist name='users' id='u'}
                                <option  value="{$u.user_id}">{$u.user_username}</option>
                                {/volist}
                            </select>
                        </div>
                        <div class="layui-col-md6 layui-input-inline">
                            <input type="text" id="key" class="layui-input search" name="key" value="" placeholder="团团赚订单号"/>
                        </div>
                        <div class="layui-input-inline">
                            <button class="layui-btn" lay-submit="" lay-filter="LAY-search">立即搜索</button>
                            <button  class="layui-btn layui-btn-normal" id="empty"  lay-submit="" lay-filter="LAY-search">重置</button>
                        </div>
                    </div>
                </div>
                <!--搜索框结束-->
            </div>
            <div class="hr-line-dashed"></div>

            <div class="example-wrap">
                <div class="example">
                    <table class="layui-hide" id="test" lay-filter="demo"></table>
                    <script type="text/html" id="typeTpl">
                        {{# if(d.mo_pay_type == 1){ }}
                        支付宝
                        {{# }else{ }}
                        微信
                        {{# } }}
                    </script>
                    <script type="text/html" id="staTpl">
                        {{# if(d.mo_status == 1){ }}
                        进行中
                        {{# }else if(d.mo_status == 2){ }}
                        已开奖
                        {{# }else if(d.mo_status == 3){ }}
                        已取消
                        {{# } }}
                    </script>
                    <!--操作模板-->
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    //layui渲染数据表格
    layui.use('table', function () {
        var table = layui.table
            , form = layui.form;
        table.render({
            elem: '#test'
            , url: '{:url("Pool/morder")}'
            ,response: {
                statusCode: 220 //成功的状态码，默认：0
            }
            , page: true
            , size: 'lg' //sm小尺寸的表格 lg大尺寸
            , cellMinWidth: 150
            , limits: [5, 10, 15, 20, 25, 30]
            , limit: "{:config('pages')}"
            , loading: true
            , id: 'testReload'
            , cols: [[
                {type:'numbers', width: 80, title: '序号'}
                , {field: 'mo_order_num',width: '', title: '团团赚单号', align: 'center'}
                , {field: 'storeName',width: '', title: '店主用户', align: 'center'}
                , {field: 'user_username',width: '', title: '购买用户', align: 'center'}
                , {field: 'getName',width: '', title: '中奖用户', align: 'center'}
                , {field: 'mo_pay_money', width: '', title: '支付金额', align: 'center'}
                , {field: 'p_name', width: '', title: '商品名字', align: 'center'}
                , {field: 'mo_pay_type', width: '', title: '支付方式', align: 'center',templet:"#typeTpl"}
                , {field: 'mo_status', width: '', title: '订单状态', align: 'center',templet:"#staTpl"}
                , {field: 'mo_time', width: '', title: '时间', align: 'center'}
            ]]
        });
    });
</script>
</body>
</html>